﻿@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'laydate', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            common = layui.common;
        //权限字段
        common.authorizeFields('adminform');
        var id = $.request("Id");//获取数据id
        $(function(){
            //反填信息
             common.ajax({
                    url: "/STZBManage/Weapons/GetFormJson",
                    data: { id: id },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        common.val('adminform',data); //赋值
                        form.render();
                    }
                });
        });
        wcLoading.close();
        //监听提交
        form.on('submit(saveBtn)', function (data) {
                var postData = data.field;
                postData.Id=id;
                common.submitForm({
                    url: "/STZBManage/Weapons/SubmitForm",
                    param: postData,
                    success: function () {
                        common.parentreload("data-search-btn");
                    }
                })
            return false;
        });
    });
</script>
<body>
    <div class="layuimini-container ">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form" lay-filter="adminform">
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">武器名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="Name" name="Name" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">武器词条</label>
                    <div class="layui-input-block">
                        <input type="text" id="Entry" name="Entry" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">武器档位</label>
                    <div class="layui-input-block">
                        <input type="text" id="Gear" name="Gear" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">四通价格</label>
                    <div class="layui-input-block">
                        <input type="number" id="Price" name="Price" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</body>
